﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;

namespace SudokuWPF.Converter
{
    /// <summary>
    /// 用于将倒计时器的时间转换为时钟上的指针的角度
    /// </summary>
    [ValueConversion(typeof(double), typeof(double))]
    public class AngleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (double)value * 360;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (double)value / 360;
        }
    }
}
